/**
 * JAVACC DEMO 1.0
 */
package com.apache.portal.thread;

import com.apache.portal.common.util.PortalPubFactory;
import com.apache.rpc.common.LoadRpcService;
import com.apache.tools.ConfigUtil;
import org.apache.log4j.Logger;

import java.util.HashMap;
import java.util.Map;

/**
 * description:  【aie项目特有】设备对接定时任务
 *
 * @author qihan 创建时间：2017-12-28
 */
public class ShebeiDockSchedulderJob implements ISchedulerJob {

    private Logger log = Logger.getLogger(ShebeiDockSchedulderJob.class);

    private static transient boolean ShebeiDockSchedulderJob = true;//线程执行标志

    public void run() {
        if (ShebeiDockSchedulderJob) {
            try {
                //aie_scada_start
                //				log.info("【定时任务】设备对接定时任务开始执行！！");
                ShebeiDockSchedulderJob = false;
                Map<String, Object> param = new HashMap<String, Object>();
                param.put("modelTypes", "s_sysParamManager");
                param.put("resultType", "processSql");
                param.put("sqlKeyId", "aie013");//aie013=（aie）中间表对接设备定时任务插件-DockingShebeiPlugin
                param.put("sysPass", ConfigUtil.getInstance().interfacePass());
                param.put("beforMethodKey", "aie013");
                LoadRpcService.service()
                        .doServiceClient(PortalPubFactory.getInstance().getBeanId("aiemesService"), "dymicSql",
                                param, PortalPubFactory.getInstance().getRpcInfo("ius"));
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                ShebeiDockSchedulderJob = true;
            }
        }
    }

}
